package com.zzty.txj.dao;


import com.zzty.txj.entity.Sport;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SportMapper {
@Insert("insert into sport (userId,type,date) values (#{userId},#{type},#{date})")
    public Integer count(Sport sport);
@Update("update  sport set type=#{type} where userId=#{userId}")
    public Integer typeCount(Sport sport);
@Select("select * from sport where userId=#{userId}")
    public Sport getSport(Sport sport);
@Select("select * from sport where date=#{date} and userId=#{userId}")
    public List<Sport> getUser(Sport sport);
@Select("select * from sport where date=#{date} and userId=#{userId}")
    public Sport getSportType(Sport sport);
@Update("update sport set startTime=#{startTime} where date=#{date} and userId=#{userId}")
    public Integer getCount(Sport sport);
@Update("update sport set middleTime=#{middleTime} where date=#{date} and userId=#{userId}")
    public Integer getMcount(Sport sport);
@Update("update sport set finishTime=#{finishTime} , spendTime=#{spendTime} where date=#{date} and userId=#{userId}")
    public Integer getScount(Sport sport);
    @Update("update sport set type=#{type} where date=#{date} and userId=#{userId}")
    public Integer getType(Sport sport);

    @Update("update sport set img1=#{img1} where date=#{date} and userId=#{userId}")
    public Integer updateImg1(Sport sport);


    @Update("update sport set img2=#{img2} where date=#{date} and userId=#{userId}")
    public Integer updateImg2(Sport sport);

}
